package com.java.demo.component;

import com.java.demo.entity.User;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Controller;

@Controller
@Order(10)
public class UserBeans2 {
    @Bean
    public User getUserByName() {
        User user = new User();
        user.setUserId(2);
        user.setUsername("王五");
        user.setPassword("123456");
        user.setAge(20);
        return user;
    }
    /*@Bean(name = "user3")
    public User getUserByName(String name) {
        User user = new User();
        user.setUserId(2);
        user.setUsername("王五");
        user.setPassword("123456");
        user.setAge(20);
        return user;
    }*/
}
